﻿@using MySoftWare.BaseModel;
@model List<MenuModel>
@{ 
    var MenuList =  from Menu in Model
                    where Menu.Level ==1
                    orderby Menu.MenuID
                    select Menu;
    foreach (var Single in MenuList)
    {
        <a class="menuitem submenuheader" href="">@Single.MenuName</a>
        var ChildList = from Child in Model
                        where Child.MenuParent == Single.MenuID
                        orderby Child.MenuID
                        select Child;
        <div class="submenu">
            <ul>
                @{
                    foreach(var ChildMenu in ChildList)
                    {
                        var MenuUrl = ChildMenu.MenuUrl + "?MenuID=" + ChildMenu.MenuID;
                        <li><a href="@MenuUrl" title="">@ChildMenu.MenuName</a></li>
                    }
                 }

            </ul>
            </div>
    }   
}
<a class="menuitem submenuheader" href="">Subcategories</a>
    <div class="submenu">
        <ul>
        <li><a href="">Sidebar submenu</a></li>
        <li><a href="">Sidebar submenu</a></li>
        <li><a href="">Sidebar submenu</a></li>
        <li><a href="">Sidebar submenu</a></li>
        <li><a href="">Sidebar submenu</a></li>
        </ul>
    </div>  
 <a class="menuitem_green" href="">Green button</a>
     <div class="submenu">
        <ul>
            <li><a href="">Sidebar submenu</a></li>
            <li><a href="">Sidebar submenu</a></li>
            <li><a href="">Sidebar submenu</a></li>
            <li><a href="">Sidebar submenu</a></li>
            <li><a href="">Sidebar submenu</a></li>
        </ul>
    </div>
<a class="menuitem_red" href="">Red button</a>
    <div class="submenu">
        <ul>
            <li><a href="">Sidebar submenu</a></li>
            <li><a href="">Sidebar submenu</a></li>
            <li><a href="">Sidebar submenu</a></li>
            <li><a href="">Sidebar submenu</a></li>
            <li><a href="">Sidebar submenu</a></li>
        </ul>
    </div>